#include "contiki.h"

#include <stddef.h>
#include <stdint.h>
#include "bsp/bsp_rtimer.h"


void rtimer_arch_init(void) {
  bsp_rtimer_init(1000);
}

void rtimer_arch_schedule(rtimer_clock_t t) {
  rtimer_clock_t c = t - rtimer_arch_now();

  // start the trigger
  bsp_rtimer_trigger(c);
}

/* just use the system tick */
rtimer_clock_t rtimer_arch_now() { 
  return clock_time();
}


void rtimer_isr(){
   rtimer_run_next();
}

/**
 * @}
 */